package cn.xiaopengstack.domain.credit.even;

import cn.xiaopengstack.domain.xxx.model.valobj.TradeNameVO;
import cn.xiaopengstack.domain.xxx.model.valobj.TradeTypeVO;
import cn.xiaopengstack.types.config.RocketMqTopicProperties;
import cn.xiaopengstack.types.event.BaseEvent;
import cn.xiaopengstack.types.utils.SpringContextUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

/**
 * @author jiangyangang
 */
@Slf4j
public class CreateAdjustSuccessEvent<T> extends BaseEvent<CreateAdjustSuccessEvent.CreateAdjustSuccessEventMessage> {

    public CreateAdjustSuccessEvent(CreateAdjustSuccessEventMessage data, String key) {
        super(data, key);
    }

    @Override
    public String topic() {
        return SpringContextUtil.getBean(RocketMqTopicProperties.class).getSendCreditAdjustSuccessTopic();
    }

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class CreateAdjustSuccessEventMessage implements Serializable {
        /**
         * 用户ID
         */
        private String userId;

        /**
         * 外部单号
         */
        private String outBusinessNo;

        /**
         * 返利的名字
         */
        private TradeNameVO tradeNameVO;
    }
}
